var http=require('http');
var fs=require('fs');
//var queryString=require('queryString');
//var urlLib=require('url');

var server=http.createServer(function(req,res){
	//req.url='/index.html'
	//读取./www/index.html
	
	var file_name='./www'+req.url;
	
	fs.readFile(file_name,function(err,data){
		if(err){
			console.log("aa")
			res.write('404');
		}else{
			console.log("aa")
            res.write(data);
	}
        res.end();
	})

	console.log("bb")
	
})
server.listen(8080);